package com.feiwo.nonego.rpc.protocol.response;

import com.feiwo.nonego.rpc.protocol.base.RpcMessage;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author feiwo 2025-08-05
 */
public class RpcResponse extends RpcMessage implements Serializable {

    @Serial
    private static final long serialVersionUID = 2498583073930383853L;

    /**
     * 错误消息
     */
    private String error;

    /**
     * 返回结果
     */
    private Object result;

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "RpcResponse{" +
                "error='" + error + '\'' +
                ", result=" + result +
                '}';
    }
}
